throw exception if extension not set