add init() function to move loading efforts to the first query