fixed bug where non-promise results result in an error