fix calculation