made sure that the hack is only called if local files are requested and not any json