typeof operator did not work with local variants