I\'m trying to retrieve the 2 attributes of seprated function and I debug there values before the end of the function and they have a value but the return value is alwas und
because function STAAPlanlat doesn't return any value. your anonymous function returns lan but it is asynchronous callback.
add this before return lan;: