Fixed query for user on error page