Added propper closing.. maybe