use path.basename rather than hack