Fix error message when closing html which was never opened