modified logging part