fix bug on ES, enhance check