modified for new protocol, hash, chat api