Change logic for html5Handler