add strip and improve close