fixed bugs with browser compatibility and added a function to get rid of
uld unwanted files.