nasty edge case in promise creation