use typeof instead of type