Fixed proper state setting