separated DB from main & add DB query to gui