Added user tracking logic to User.rb