fixing logic on glue.c