fix bug of calculating fragment energy