Added event listener to trigger save event