added promises and load logic