fix reconnecting to DB