Fixed improper  comparison of values