rearranged to avoid null grub variable