fixed possible input issue