add logging, fix key format