update fancybox and some minor code bugs