bugfix in promise rejection