better app id retrieval