prevent done() from being called multiple times