fixed bug in glib case for directories