improved local src logic