using promises in animation complete