add extention and generate id