Fix bug: locations were unnecessary retrieved twice.