dataAvailable method backported to 2.4

I already did this for 3.0 earlier, now for 2.4