PP:fixed a bug with calculation