added validation before saving property