add auto loading functionality