fixed server stop when called from binary