removed errors(), now uses R built-ins