Prevent stack overflow