added ensure and record delete stuff