added user checking for userkey insertion and updates