changed to use std error