bug fixed for flash unlock when restart count is larger than 250