Added debug messages

added console logging.