Added a memory latch, but still have some error'