modified lib for existing files