added function to the nav buttons