fix some checks on cahce size