[#10] Added null check to make it possible to shutdown server on any issues