Fixing a bug about double rendering when cache is enabled

In order to close issue Pajk/#86