Fix bug where done callback would not get triggered