Fixed getFacters function