Fixed problem with scheduled task