mistake in if-clause corrected