added convert_value function