fix root_path detection