more exception checking