Added promise guards.