fix check_path not using path variable