Fixes bug when heartbeat is received before CONNECTED frame