added control on navigation bar. In case it is no object, no html