redo of Davids fancybox fix