function to keep track of the current nav's active item