moved html opening to more proper location