added cache edit (thanks to uroboro), still bugs to be fixed