Using wrong type - list not dict - when directory not found