some debugging code added