implemented file and directory loading