adds profileKey, and checks for unexpected errors on insert