wrapping functionality added on both next and previous