api get_next method re-fix