fix condition to not return error