fixing weird bug in cellreencoder