merge two if statements