use php exception instead of pear error