fix database error due to multiple unused tables