Are you sure this if/else is correct, seems irrational to me.