fixed missing return value on extend function