Fixed prepare_latest callback