with (something or someone) in mind
While regarding or thinking about someone or something; keeping someone or something in consideration. You've been a loyal employee for over 20 years, with no such incident like this in the past. With that in mind, we're only going to give you a suspension of three weeks unpaid leave. I wrote this song with my late wife in mind.
with something in mind
for a particular reason: He wrote the book with his son in mind (= for his son).I went out for a drive, with no particular destination in mind.