implement some functions to make it work with the current GUI