added debugging code and of course it works now.