connect_db and register both debugged and tested!