database client now gets closed properly