Fixed the fact that it was skipping the if and going straight to the else