Had to fix some logic on convert_val