Fix stackoverflow