Refactored header zoom to prevent errors