If you're genetically pre-disposed to baldness and take T, you can expect baldness. While it is concerning that it happened so quickly to you, it isn't something that would necessarily be avoidable if it's genetically related.
Like Dena mentioned, you could try lower doses or a different concentration of T to see if those options help.
You could also look into Finasteride. I believe I heard of at least one other guy taking it when he started losing hair, but can't personally speak to whether or not it'll help you.