Made write_value set before it's referenced