To the person who asked the question:
If you can identify the chords of a piece; you may want to opt for a chord by chord approach to soloing.
For example if you know that the chord is a "D major Chord" then play a D major scale, and if it changes to "Fm#" then play an Fm# scale.
That is a safe way of soloing.
Empirical but effective.