fix bug with conditional