adding logging to find bugs