fix html generation bug