added debug helper function