Updated query string detection. Props @jfbon