Fixed bug in profile by changing the query