changed some input logic