add forking code so that we kill the old master

fixes #5