added on_load hook to know when a document is being loaded from MongoDB