Remove flickering on navbar with new code