Remove time dependency and add check for equal keys on insert