connect to DB and mini changes so that it works