fixed empty PID file bug