fix redundant conditions