fixed bug for typeof/instanceof