added logic to register the student