fix disconnected check and rename the method

issue #332