last insert functions are simplified for debugging