cleanup and fixed minibuffer