add debugging for pan problem