added clause for test mode