modified pre, next button functions