fix rest bug