Updated DLL to support external database