Move DB Conn. to loop