Adding conole.logs to troubleshoot problem