change return null to throw exception