added pid file functionality