how to add a scheduled task though coding ?