Predicting and preventing mistakes in human-robot collaborative assembly