Added send input logic