add debugging to find root of problem