fixed ref to nav element, which is now optional