add alertlog and modify some function