Prevent maximum recursion depth
Proper class attributes
add test try-except