logic should work. still getting held up by the JS finishing before the ajax request is complete.