fix bugs make its work with new object for new connection