Fixed issues, query works