fixed some of issues, lots of additional logging