non working recursive loop