center the location box only when is necessary