fix old database support