persisting data with AJAX such a mess omg