fixing semantic bug