add edit code to gui for refex