fix calculation mistake