null check for locations