Make next function optional.