Following changes made :-
- debug statements removed
- changed pid argument to sched_*