Today and yesterday it has been raining in my area. Yesterday I rode in not caring too much about the rain. However, on my ride home my chain slipped of the gear

. Can anyone tell me if this could have been in part due to the rain? Or is it just that I'm new to riding and might have changed gears wrong? I was at a light and about half way through I changed from my 1st front gear to my 2nd front gear (3x8) and that is when the chain hopped off. It was easy to put it back on and I continued my ride but this was the first time this happened so I could use some insight as to why. Other than that the ride in and ride home yesterday was good, but I drove in today because I have an appt. that I will have to drive to this afternoon. Anywhoo....any tips on my chain issue or just proper gear changing would be greatly appreciated from you more experienced riders. Thanks