fixing type mismatch for enum from integer