merge ibex's code with stable. plz try/