replace extend function with lodash.extend