fixed storing worng PID of the app