Fixed bug where state was incorrectly set onLoad()