Fixed bug in calling schedule_job
Fixed bug that called an invalid sql function.