fix bugs around sram controller