added check to see if we are in test mode or production mode