turning error, added some debugging