Fixed an issue with stopping server