Fix issue1 multiple instances

Fix for issue #1 using a pid file.