Fixed the compilation errors, cache fails, need to implement circular cache buffer