add middleware
init