Fixed incorrect check