fix for conditional expression is ambiguous