fix mismatched filename and make attributes conditional