i hate you ajax. finally it works