fixed for binary encoding (could not submit error in testing setup)