added console.log debugging