Core dump after changing schedule_instr() funcitons