implemented gloal closing