Fix serious bug
Fixed recursive call that leads to stackoverflow