fix res and count plot