adding log statements to help debug