Fixed bug on getting directiosn