Added handling of input