Fixes bad if else block