Implement close and open comands