same as before...log error instead of stdout