add event of documentloaded to view