close process incase api connection is error