added code to center window