fix bug in conditionals