Fixed Ajax to be Async, code is a mess now but works