Why == instead of equals as it is in if statement 2 lines before?