added cache options, and fixed some stuff