bugfix in remove_text