Automation time not working correctly