fix bug in rest/map