Make sure pins is not undefined