Closing old connections before using db connection, in an attempt to fix #31