I changed state residency midyear due to military retirement. Am I subject to taxes for the entire year to my former state, despite not living or earning money there?

I was a Missouri resident while active duty military.  I retired in 2017 while living in Maryland and subsequently changed my residency to Maryland.  Turbotax is saying I owe taxes to Missouri for all of 2017, including for my civilian and military retirement pay earned in 2017 after I was no longer a Missouri resident.