implement test mode