add config and extend function