fixed some incorrect this references
fixed window load event handling