please don't insert any middleware
make the type more clear
add test
auto reconnect