close plots correctly