Added log and error messages