Modified code such that non-logged in student activates correctly.