handle invalid inputs without failing