fix bug in text method