Added onLoad event handling