fixed db bugs with group ids, etc