fixed mistake in for cycle