Added promise functionality