auto close main acitivity