update scheduler code