bug fixes to states and scene graph