validate input
catches another rare error