fix bug to return a manager using the factory method