fix test mode bug