implemented mongo hooks