fixes update issue, creates a reference to student object in factory