rewrote get_available rapp logic