finish record code