Fixed incorrect if