Recursion error fix, added contains()