Fixed stackoverflow