passing more info to replacement function