fix for NPE occurring if database was not yet initialized