Fixed closing exception