prevent errors in browser when loading pages
fix nav dropdown