adding exception hanling and loggers