fix small bug in get_basename