revised the checkhtml initialization algorithms