fix typeof issue