Added $(document).ready() to prevent navbar flickering