bug fixes after DB abstraction