Adding log statements to debug