Fixed bug when server crashes