Fixed error while using if, else.