Fixed delete schedule function