fixed rest bug in compiler