added dbrefresh
added error messages if debug is enabled