I rebased this patch because of confliction.