added test_mode() method