updated to fix html parsing and ko script generation errors