expand console, fix db bugs