Added : better logging messages, few more error handling