removes next function