I don't understand "خَالِدٌ ذَهَبَ إِلَى الْمُسْتَشْفَى" So I have the following sentence : "خَالِدٌ ذَهَبَ إِلَى الْمُسْتَشْفَى"

The word "الْمُسْتَشْفَى" meaning hospital which is feminine because of the way it ends. (I think)

Now the only thing which I don't understand is that there is a preposition before it and from what I learned I must change a word to the genitive case in this situation. Why is it that we don't modify this word in this case ?