fixed the bug when bgnd is empty