I work in MO and live in IL. I was prompted to file taxes in both states and owed money to both. Is this correct? If not how do I get a refund?

I paid over 1k to IL and it seems that was an error.