now properly checking for and handling db connection errors.
removed reduntant checks.
properly handling loader on staticly loaded objects.
added return option to debug.