extend function for object