replace close with quit