fixed some bugs when integrating with james code