query fixes for update profile