Fix metadata being added regardless of validation