locationError function