Fixed candidate for the bug which was preventing self.state from working correctly