fix table and rc4; fix exception when shutdown; log to file