fix for race condition
Merge pull request #1 from seetheprogress/master

fis for race condition