Added log message and return value