get_potential bug: code instead of x