Bug fix, promise not resolving.