improved validation of input data, added additional log messages