Conditional logic not working in IE11