Add screenshot save and clean some codes