delete unused lines
support redirection stack