Ping Timout

So I have a ping sensor and its facing the sky, the problem is is that it starts giving random numbers, is there a timout feature on the ping sensor?

the pulsin() function with the three parameters, pin value timout does not seem to work and just gives random results. I think this is because although the arduino has timedout the actual ping sensor is still waiting. Any thoughts greatly apreciated.

Thanks