update extend function