created lock on insert/update feature