added better header skipping in readmags