enable before open callback function