fixed several things with dbmain, now at release 3