fixed the insert so that it persists the reg data