fix crash and avoid from cheating upgrade