fix a bug of persistent connection