Small update to give the correct exception