improve test condition as suggested by vmoravec