fixed formatting in the list directory method