fix type detection

typeof object is borked