fix up and debugging