Adding more logs
removing duplicated logs
more logs and proper error message when output is empty