fixed test mode checking, used query string instead