another small fix to if/else block