fix location dialog issues and apply some validation