Added logging part.