added hooks for mongodb upload.