more debug logs; improved heartbeat check and login sequence upon terminated sessions