Fixed a bug in the state handler. Pause is now working, ui renders, level renders.