Fixed a bug which caused the directories not to change properly also added ls feature