bringing back create directory logic