ADDED: Error handling for ajax form submission