fixed some type confusion