fixed #475; save hook only emitted when doc saved

before, it emitted even if no document was saved, now only emits if the
document is saved and sent to the db