refactored the query parameter fix, removed the exception, issue #2890