added functionality for minimize and close buttons
added functionality for minimize and close buttons