fix some caculate bug