work with middleware
merge