implement glib functions