fixed query for button hide/show