Fixing the location bug