fixed conditional in reducer