added debug logs