Main window, add debug for database and scanner output