added logging feature