fixed rest bug