set and unset block's trainDetected