Fixed retry on async javascirpt