fixed bug in scheduled tasks