fixed wrong if case