fixed database connection and autoloader