move loading code to bottom of page