added security checks to update