move load function to top of file