fix logging
update logging, tw rank query tool, update db