adding yet more exception handling