Fix bug with html and the bug with undefined and the bug with preview