added quit function and button