FIXED: used $text instead of $line