fixed problems with hiding mag and res by detaching