changed os.path.exists to os.path.lexists