fix bug for bg