fixed the if/else