Removed unnecessary code and fixed log message