Updated to properly return promises