some error case checks