add support for html5 mode