Dp 2864

This line is duplicated and exists in both if and else. It should be moved below condition statement.