Your cooking temperature may be too low or the cooking time is too short that it didn't cook the mixture properly. You may increase the heat until set ( do the toothpick test). If you do not want to increase the heat, add a few more minutes to your cooking time until the flan is set.