fix problem occurring in first connection