fixed avail_locations code, missing ret