delete some useless var and add return