Cycling resulting in being underweight

Been cycling too frequently and not eating that healthy and notice that I have become slightly underweight now. Is there a way to prevent myself from going too low while still enjoying cycling?