Fix the issue when no location is selected