added lock for non duplication