mode string compare bug fixed