add empty base optimization check