Fix bug in comparing text