updated skip function