Bug fixed with dot product operator.