add in err logging