fixed db, implemented dialog