Add logic for ajax, not complete