log messages implemented and bug fixing