Happens to me about 60% of the time, and even more when I don't have a good hook. If you learn your players well, you can have some solutions to remedy the situation. If it is a low level side quest that was the evenings agenda I have even been known to just use the same dungeon I originally planned and fill it in. My players say that the ones that are off the top of the head are the most memorable though. If your players are having fun then you aren't doing anything wrong, just could use some ready remedies to ease the stress that might develop. I have a printout of all of the enemies by challenge rating to have a quick look up available. After a while you can just do any adventure from the top of your head, but be careful about it. Many players like to know that the DM is at least using the book for the stats and not making stuff up. Bottom line, know the game and have fun!