Fixed close functionality, added minimize button