also copy function properties while wrapping function