Server stops working after a few moments