socket issue: will create first record every time if haschanged=true