init
Added exit on close