open and close on commands