fixed wrong if