first try to implement directory support