Added function in User model