added handling input data