changed mode='raise' to mode='safe' - contact adam about this