exit 1 if invalid filename