added load directory code