Fixed the issue with posting array of data via AJAX