Fixed error handling for new reference form