added validation checks