#567 Fix onload issue