fix connectors in beginning and end error bug