minor sql query change in userclass function