Prevent stack overflow error