added functionality for html preview