fixed wrong raise condition