Fixed error of server exiting prematurely