fixing date handling and scheduling a task