added different train or test mode