[nit] logging and bug fixing