removed deprecated charCode check