corrected method of passing params from controller to factory