Fix issue caused by unprepared connection