use document ready instead of window onload