resolves issue when query is empty