Update public.js

In some cases Files does not exists. This fixes the Reference Error.