make sure we get a proper File object or an error