fix debug and log