added state function