Accept int or string & handle invalid values