better location handling for userdata.