use getpwuid for home directory in case environment variable is empty
maintain environment on process spawn
wait for threads to start