added check for not corrupting master data
added validation checks