Added check for termination symbol