Fixing the pickupticket function