add more protection for rubbish input