removed unnecessary write opens