Few safeguards if cache history not available/expired

Signed-off-by: Atul Pratap Singh <atulpratapsingh05@gmail.com>