fixed possible input error