fixed random corrupt cached package errors due to global variable expectedHash