added state toggle