fixed some rest bugs