fixed bad condition logic #2