Modified to randomly generate secure token