Error when opening a second window from clicking a button