added keep alive parameter, fix #29