do write on button press instead of load