added function to see if directory