Modify if statement
Add some statements to pane and window part