Updated to correctly append to the list of errors