rebuild the code,now it is fine for all main functions.