added some debug printout
bug fixed