fix check for isBytes before cast in Value