add missing functions, more logging