Vehicle not near me crashing client

I spawn a regular gta car then I drive away from a long ways and when i return it is still there, so i do that again driving far away and try to check something on it and my client crashes.

I check if veh then and it passes
I get veh model and then check IsModelValid(model) and it crashes
i try IsEntityDead(veh) and it crashes

I need to detect the vehicle exists, or is it in stream range? or any way to validate? if I can get data from it without crashing. how??