Added the test for the error checking
for the function getToken identifier part
Modified and added some new code to the getToken function