fixing bug when comparing against enum value