add get_caps while loop