added base case for empty spells