add local cache and fix bug about black screen in device