changed query for the first chart