Fix code
Implement getDirectory method