add auto select pk and save temp file