Add option to always hide the previous button. Remove the window closing listener