Add "timeout" parameter to prevent app hanging