Fixed issues with setting State in Unit