update schedule function