fixed tristate logic in ram/rom