updated python file to include proper async polling