fix some queries and update profile of users