Add load event function