more error catching closes #30