added in error printing