[Misc] fix bug in error logging