Changed to use load event instead