Array check on both parts of if statement