fixed bug with input processing