Fixed error when no socket connections