Adding check for query string, closes #2