Handle ValueError when setting incorrect type