add retype functionality