corrected error related to last_step method in model