Fixed server exit bug