moves process exit to create function, so it is in sync with destroy