added int param to control input type.