fixing head_matter so internal paths work