changed save event to on input event handler