fix string compare logic