added save and windows resize listener