fix undefined variable on logs