fixed db, needs work on queries