improve spellcasting detection