fixed bugs caused by incorrect settings being used