Add automatic registration of the on-save handler