This can throw exceptions, e.g. when a misspelled/invalid rapp is provided. Please add exception handling.