Added check for code before trying to authorize with stored credentials