better heading handling