saving before starting on ajax and backend