make the availability check less error prone