devise update bug and fixed some bugs