Added check if token not specified

My app crashes if no token is specified. 
This PR fixes this error.