fix bug with wrong on conditions in the view