error util function, removed testing output