fixing up events for next button