addded logging