bugfix in loader code