add open/close function for post