fixed error in register file writing