If you sliced up an apple, brought it to work, and then noticed it had turned a less-than-appetizing brown by the time you sat down to eat it, you may wonder why that happened — and more importantly, if it’s still safe to munch on.

“When fruit is cut, peeled or bruised, it causes cell membranes within the fruit to explode and release an enzyme called polyphenol oxidase,” Keri Gans, nutritionist and author of The Small Change Diet, told YouBeauty. “This enzyme then mixes with oxygen — also know as oxidation — and the result is browning.”

But is it okay to eat? Yes, according to Gans. “It’s totally safe to eat, but the taste may change and not be as desirable,” she pointed out.

If you’d prefer to keep your produce blemish-free in the future, don’t cut it up until you’re ready to eat or serve it. If you still want to slice up your fruit ahead of time, try this easy solution: “A little citric acid does the trick — like squeezing lemon juice on it,” says Gans. That’s because the citric acid found in lemon, as well as other juices such as pineapple, contains antioxidants, which counter the oxidation that causes browning in the first place.