changes to the user.rb to resolve a bug with the register method