fixed bug in promise return
added polling until true