Fixing minor bug preventing state from being maintained.