moved connetion to BD