added the navigation buttons functionality