Fixed a bug with input