Fixed an issue with scoping in user.rb