fix pocket detection