Fix merge commit error

During the merge commit hadn't noticed how much the file had changed.
The if/else had completely changed.

This commit should restore the previous behaviour we had