Fix totally broken last commit, misread the existing code