moved div creation to eliminate erroneous 'thank you' divs