Checking stack length to only list files on folder if cd is called directly