adding functions for changing window state