Fix ajax to only call once