Adding navaigation logic