added logging pattern