removing bug caused by running in a subshell that prevents exit