fixed up magic and attach