fixed bug
changed to input watching method