fixed possible onload error and commented some code