changed freeze into a promise