added --local-storage option and fixed element filtering