fix for 336

I am not sure what cause the multiple confirm popup but moving the click action to a doc ready seems to have fixed the problem