fixed next bug