Change pmap to map
Try catch more exceptions