Added document onload function