Fixed place where error invalidated connection and crashed server