fix valueOf for enum management