Fix periodic task execution