adding error field to ajax request