Attempting to resolve issue 597 by first declaring local pid_file= to null in check_status()