added logging mechanism