extend function fix