Edit: Of course after posting this and rewriting my entire code out of desperation, it works exactly the way I wanted it to. Embarrassingly enough, I originally left out a bit of code that I didn't think applied to the situation and that's exactly what was wrong.
Lesson learned.