Fixed keep alive bug