fixed connection close statement.