added a resize listener for navigation bar