fixed mistake in test function