fix calculation issue