The problem with this is that this calls the callback twice in case of an error.