fix bug logical expressions