Fixed an issue with the onload function, added proper events to load addon correctly when it is done.