Fix condition for keepalive. Fixes issue #23

The keepalive check didn't work anymore