Adding .resolve() function