Updated PID_SEARCH and added lines to remove a stale pid file