Restored important validation check, which was accidentally deleted