fixing db connect bug