This can happen if you have made it without using any preservatives. Using natural preservatives (oil and salt) or synthetic preservatives (vinegar) will help prevent it from turning green.