bug fix to factory loader