fixing navbar variable to initially null instead of empty array