make tests more reliable by using multi-stage latches