fixed a bug when firstConnection is not known