moving code in onload, and calling it explicitly. (old way worked only in firefox, but not chrome)