Added test_mode to query to make sure no errors get thrown