set ID if it doesn't exist
cleanup