some fix and debug helper