add else to directory test