fix timing problem latch