switch initializtion to promise