Can you tell which pulse Oximeter module you have ? and how is it connected ?
Are there other pins connected to the Oximeter module ?
In the library of the Oximeter is code to return zero when the tracking is lost. I don't understand the condition when that happens. Maybe the Oximeter update() function has to be called more often.